import 'package:json_annotation/json_annotation.dart';

part 'user.g.dart';

///
/// 用户
///
@JsonSerializable()
class UserModel {
  String name;
  String avatar;

  @JsonKey(includeFromJson: false, includeToJson: false, defaultValue: false)
  bool checked;

  UserModel({required this.avatar, required this.name, this.checked = false});

  factory UserModel.fromJson(Map<String, dynamic> json) => _$UserModelFromJson(json);

  Map<String, dynamic> toJson() => _$UserModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}
